package com.itdl.common.base.properties;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.List;

/**
 * MQ properties
 */
@ConfigurationProperties(prefix = "redis.mq", ignoreInvalidFields = true)  // prefix:属性配置前缀, ignoreInvalidFields: 忽略字段的校验
@Data
public class CustomStreamMqProperties {

    private List<StreamConfig> configs = new ArrayList<>();

    private List<TopicConfig> topics = new ArrayList<>();

    @Data
    @EqualsAndHashCode(callSuper = false)
    @NoArgsConstructor
    @AllArgsConstructor
    public static class StreamConfig {
        // 消息队列名称
        private String queueName;
        // 消息监听器的全限定名称
        private String messageListenerFullName;
    }

    @Data
    @EqualsAndHashCode(callSuper = false)
    @NoArgsConstructor
    @AllArgsConstructor
    public static class TopicConfig {
        // topicName
        private String topicName;
        // 消息监听器的全限定名称
        private String messageListenerFullName;
    }

}
